import 'package:flutter/foundation.dart';
import 'package:get/get.dart';
import 'package:ui/api/config.dart';
import 'package:ui/view/home/logic.dart';

Future startFunc() async {
  final HomeLogic homeLogic = Get.put(HomeLogic());

  debugPrint("启动函数Run........");
  // 初始化数据库
  db.initdb().then((n) {
    homeLogic.getProfileList();
  });
  await config.getdate();
  if (config.settingLogic.uid.value == "") {
    debugPrint("没有uid - 去配置");
    config.tabViewLogic.position.value = 1;
    config.tabViewLogic.pagecon.jumpToPage(1);
    // 配置页
  } else {
    // 首页
    debugPrint("有uid - 去首页");
    config.tabViewLogic.position.value = 0;
    config.tabViewLogic.pagecon.jumpToPage(0);
  }
}
